#include <QtGui/QApplication>
#include "colortray.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QApplication::setQuitOnLastWindowClosed(false);
    ColorTray w;

    if (!QSystemTrayIcon::isSystemTrayAvailable())
    {
        QMessageBox noTrayBox;
        noTrayBox.setWindowIcon(QIcon(":/files/tray.png"));
        noTrayBox.setIconPixmap(QPixmap(":/files/tray.png"));
        noTrayBox.setWindowTitle("ColorTray error");
        noTrayBox.setText("System tray not found.");
        noTrayBox.setInformativeText("Please enable system tray to use this program.");
        noTrayBox.exec();

        return 1;
    }

    return a.exec();
}
